const { contextBridge, ipcRenderer } = require("electron");

window.addEventListener("DOMContentLoaded", () => {
  contextBridge.exposeInMainWorld("$", {
    sendIpc: (event, value) => ipcRenderer.send(event, value),
    onIpc: (event, back) => {
      ipcRenderer.on(event, (e, value) => {
        back(e, value);
      });
    },
  });
});
